var WxParse = require('../../wxParse/wxParse.js');
//获取应用实例
var app = getApp()
Page({
  data: {
    
  },
  onLoad: function (e) {
    var that = this;
    app.setNavtitle("我的店铺");
    
  },
  onShow:function(){
    var that = this;
    that.requestDetail();
  },
  requestDetail: function () {
    var that = this;
    var data = {
      map: 'applet_mobile_shop_detail'
    };
    data.lng = that.data.curChooseLongitude ? that.data.curChooseLongitude : 0;
    data.lat = that.data.curChooseLatitude ? that.data.curChooseLatitude : 0;
    console.log(data);
    wx.showLoading({
      title: '加载中',
      mask: true,
      time: 100000
    })
    wx.request({
      url: app.globalData.requestUrl,
      data: data,
      success: function (res) {
        console.log(res.data);
        if (res.data.ec == 200) {
          that.setData({
            detailInfo: res.data.data
          })
        } else {
          console.log(res.data)
          app.errorTip(that, res.data.em, 2000);
        }
      },
      complete: function () {
        wx.hideLoading();
      }
    });
  },
  torenewShop:function(e){
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/subpages/renewShop/renewShop?id='+id
    })
  },
  myShopinfo: function () {
    wx.navigateTo({
      url: '/subpages/shopTelinfo/shopTelinfo'
    })
  },
})
